Global Index
HTML5 JS API Index > Web Workers Tutorials & Specs

WorkerGlobalScope

Extends EventTarget. Implements ImageBitmapFactories, WindowTimers, WindowBase64.

Extended by DedicatedWorkerGlobalScope, SharedWorkerGlobalScope
Properties
WorkerLocation
location
The location attribute must return the WorkerLocation object created for the WorkerGlobalScope object when the worker was created. It represents the absolute URL of the script that was used to initialize the worker, after any redirects.
OnErrorEventHandleronerror
EventHandleronlanguagechange
EventHandleronoffline
EventHandlerononline
WorkerGlobalScope
self
The self attribute must return the WorkerGlobalScope object itself.
Operations
DOMStringatob(DOMString atob)
DOMString
btoa(DOMString btoa)
The btoa() method must throw an InvalidCharacterError exception if the method's first argument contains any character whose code point is greater than U+00FF. Otherwise, the user agent must convert that argument to a sequence of octets whose nth octet is the eight-bit representation of the code point of the nth character of the argument, and then must apply the base64 algorithm to that sequence of octets, and return the result.
void
clearInterval(optional long handle)
The clearTimeout() and clearInterval() methods must clear the entry identified as handle from the list of active timers of the WindowTimers object on which the method was invoked, if any, where handle is the argument passed to the method. (If handle does not identify an entry in the list of active timers of the WindowTimers object on which the method was invoked, the method does nothing.)
void
clearTimeout(optional long handle)
The clearTimeout() and clearInterval() methods must clear the entry identified as handle from the list of active timers of the WindowTimers object on which the method was invoked, if any, where handle is the argument passed to the method. (If handle does not identify an entry in the list of active timers of the WindowTimers object on which the method was invoked, the method does nothing.)
voidclose()
Promise
createImageBitmap(ImageBitmapSource image, optional long sx, long sy, long sw, long sh)
An ImageBitmap object can be obtained from a variety of different objects, using the createImageBitmap() method.
voidimportScripts(DOMString urls...)
long
setInterval(any handler, optional long timeout, any arguments...)
The setInterval() method must return the value returned by the timer initialization steps, passing them the method's arguments, the object on which the method for which the algorithm is running is implemented (a Window or WorkerGlobalScope object) as the method context, and the repeat flag set to true.
long
setTimeout(any handler, optional long timeout, any arguments...)
The setTimeout() method must return the value returned by the timer initialization steps, passing them the method's arguments, the object on which the method for which the algorithm is running is implemented (a Window or WorkerGlobalScope object) as the method context, and the repeat flag set to false.